Skip to content

feat(tables): preview referenced rows and warn on referenced deletes - #7106

Open
j15z wants to merge 10 commits into
feat/table-fksfrom
feat/reference-row-preview
Open

j15z wants to merge 10 commits into
feat/table-fksfrom
feat/reference-row-preview

Conversation

@j15z

@j15z j15z commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reference cells show the target table's name as a chip and open the referenced row inline
  • One batched name request covers every Reference column on a table; the preview loads the referenced schema and row together, so no placeholder content flashes
  • Deleting a table that other tables reference is allowed. The table, bulk, and folder delete dialogs warn "Reference columns in … will point to a missing table" so users know which tables are affected
  • References to a deleted table resolve as not found: the chip falls back to "Referenced table" and the preview shows "Table not found". Restoring the table brings them back
  • Earlier revisions blocked deleting referenced tables (reference-graph scans, cohort archive/restore, folder retry waves). That is removed in favor of the warning
  • Workspace fork copies referenced tables and rewrites references to the copies; a reference to a deleted table is kept as-is instead of failing the fork
  • One registry accessor answers which tables a column references — the grid, preview, delete warning, fork remapping, and schema validation all read it, so a second referencing column type is one registry entry
  • Chips, name lookups, previews, and the warning all sit behind the Reference columns flag from feat(tables): add reference columns #7105
  • Builds on feat(tables): add reference columns #7105

Type of Change

  • New feature

Testing

  • Tested manually in the browser: table-page, list, bulk, and folder delete dialogs; the live preview; and the preview after deleting the referenced table
  • Table, folder, fork, preview, and query-hook suites: 33 files, 577 tests
  • bun run type-check, bun run lint, bun run check:audits (45 audits), bun run check:react-query, bun run check:client-boundary

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not attached — the delete dialogs and both preview states were exercised locally against a dev workspace.

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 16, 2026 3:15am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds inline previews for referenced table rows, backed by bounded table-name queries and on-demand schema and row loading.

  • Renders reference values as table-name chips that open an inline row preview.
  • Adds batched table-name lookup and reference-preview query support.
  • Preserves reference integrity across copying, archive and restore, row mutation, and bulk deletion.
  • Consolidates bulk-delete reference-graph scanning and rejects unsupported cycles.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/reference-row-preview.tsx Implements the inline referenced-row preview and includes the completed normal-weight header fix.
apps/sim/hooks/queries/tables.ts Adds bounded table-name and on-demand reference-row queries with refresh and local-mutation invalidation behavior consistent with the documented snapshot semantics.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx Integrates reference-cell expansion and preview state into the virtualized table grid.
apps/sim/lib/table/application/bulk.ts Batches reference-graph handling for explicit table deletion while preserving archive ordering and cycle rejection.
apps/sim/app/api/table/names/route.ts Exposes the authenticated lightweight table-name projection through the standard internal route framework.

Reviews (7): Last reviewed commit: "fix(tables): reject incomplete folder co..." | Re-trigger Greptile

Comment thread apps/sim/hooks/queries/tables.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found and verified against the latest diff

Confidence score: 4/5

  • In cell-render.tsx, double-clicking a reference chip can also trigger the cell’s inline edit mode after opening the preview, creating conflicting interactions; stop dblclick propagation on the chip to match URL cell behavior.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/cell-render.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/cell-render.tsx:409">
P2: Double-clicking a reference chip still bubbles `dblclick` to the cell, so opening the preview can also enter inline edit mode. Stop double-click propagation on the chip, matching the URL cell behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@j15z
j15z requested a review from a team as a code owner August 29, 2026 05:41
@j15z
j15z force-pushed the feat/reference-row-preview branch from bc7186a to e4ded13 Compare September 2, 2026 07:35
@j15z
j15z force-pushed the feat/reference-row-preview branch from e4ded13 to a3d2126 Compare September 2, 2026 07:38
@j15z
j15z force-pushed the feat/reference-row-preview branch from a3d2126 to 5eef2b1 Compare September 2, 2026 17:30
@j15z
j15z force-pushed the feat/reference-row-preview branch from 5eef2b1 to 2921222 Compare September 2, 2026 17:31
@j15z
j15z force-pushed the feat/reference-row-preview branch from 2921222 to 2deec54 Compare September 2, 2026 18:34
@j15z
j15z force-pushed the feat/reference-row-preview branch from 2deec54 to 1b145fe Compare September 2, 2026 20:57
@j15z
j15z force-pushed the feat/reference-row-preview branch from 1b145fe to b4cbd5e Compare September 2, 2026 21:00
@j15z

j15z commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@j15z I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 47 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@j15z j15z changed the title feat(tables): preview referenced rows inline feat(tables): preview referenced rows and warn on referenced deletes Sep 15, 2026
@j15z
j15z force-pushed the feat/reference-row-preview branch from f65a221 to 815b6c3 Compare September 16, 2026 00:27
@j15z
j15z force-pushed the feat/reference-row-preview branch from 815b6c3 to e014a54 Compare September 16, 2026 00:38
@j15z
j15z force-pushed the feat/reference-row-preview branch from e014a54 to 503183e Compare September 16, 2026 00:43
@j15z
j15z force-pushed the feat/reference-row-preview branch from 503183e to 028729e Compare September 16, 2026 02:21
@j15z
j15z force-pushed the feat/reference-row-preview branch from 028729e to 34322d6 Compare September 16, 2026 02:45
j15z and others added 10 commits September 15, 2026 20:12
Chat and Home render the table grid inline, so the preview component, its
query module, the referenced-by warning hook and the referrers lookup land in
their graphs too — five modules the feature genuinely ships, not a barrel
dragging code in. Only the three entries this branch actually grows are
re-recorded; the rest keep their existing numbers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview aeeda42b Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant